$(function() {

	var rpc_sc = echarts.init(document.getElementById("rpc_scatter_chart"));
	var rpc_so = {
		title: {
			//			text: '服务请求耗时分布',
			subtext: '服务请求耗时分布'
		},
		tooltip: {
			trigger: 'axis',
			showDelay: 0,
			axisPointer: {
				type: 'cross',
				lineStyle: {
					type: 'dashed',
					width: 1
				}
			}
		},
		legend: {
			data: ['女性', '男性', '其他']
		},
		grid: {
			x: 45,
			x2: 40,
			y2: 25
		},
		xAxis: [{
			type: 'time',
			scale: true,
			min: new Date("2015/04/14 11:30:33"),
			max: new Date("2015/10/30 11:30:56")
		}],
		yAxis: [{
			type: 'value',
			scale: true,
			axisLabel: {
				formatter: '{value} ms'
			}
		}],
		series: [{
				name: '女性',
				type: 'scatter',
				tooltip: {
					trigger: 'item',
					formatter: function(params) {
						if(params.value.length > 1) {
							return params.seriesName + ' : ' +
								params.value[1] + 'ms<br/>' +
								params.value[0] + '';
						} else {
							return params.seriesName + ' - ' +
								params.name + ' : ' +
								params.value + 'ms';
						}
					}
				},
				data: [
					[new Date("2015/08/27 11:30:23"), 51.6],
					[new Date("2015/08/29 11:30:23"), 59.0],
					[new Date("2015/09/24 11:30:23"), 49.2]
				],
				markPoint: {
					data: [{
							type: 'max',
							name: '最大耗时'
						},
						{
							type: 'min',
							name: '最小耗时'
						}
					]
				},
				markLine: {
					data: [{
						type: 'average',
						name: '平均耗时'
					}]
				}
			},{
				name: '男性',
				type: 'scatter',
				tooltip: {
					trigger: 'item',
					formatter: function(params) {
						if(params.value.length > 1) {
							return params.seriesName + ' : ' +
								params.value[1] + 'ms<br/>' +
								params.value[0] + '';
						} else {
							return params.seriesName + ' - ' +
								params.name + ' : ' +
								params.value + 'ms';
						}
					}
				},
				data: [
					[new Date("2015/07/17 11:30:23"), 53.6],
					[new Date("2015/08/24 11:30:23"), 69.0],
					[new Date("2015/09/13 11:30:23"), 89.2]
				],
				markPoint: {
					data: [{
							type: 'max',
							name: '最大耗时'
						},
						{
							type: 'min',
							name: '最小耗时'
						}
					]
				},
				markLine: {
					data: [{
						type: 'average',
						name: '平均耗时'
					}]
				}
			},{
				name: '其他',
				type: 'scatter',
				tooltip: {
					trigger: 'item',
					formatter: function(params) {
						if(params.value.length > 1) {
							return params.seriesName + ' : ' +
								params.value[1] + 'ms<br/>' +
								params.value[0] + '';
						} else {
							return params.seriesName + ' - ' +
								params.name + ' : ' +
								params.value + 'ms';
						}
					}
				},
				data: [
					[new Date("2015/07/27 01:30:23"), 51.6],
					[new Date("2015/08/29 10:30:23"), 59.0],
					[new Date("2015/09/24 21:30:23"), 49.2]
				],
				markPoint: {
					data: [{
							type: 'max',
							name: '最大耗时'
						},
						{
							type: 'min',
							name: '最小耗时'
						}
					]
				},
				markLine: {
					data: [{
						type: 'average',
						name: '平均耗时'
					}]
				}
			}
			
		]
	};
	rpc_sc.setOption(rpc_so);
	$(window).resize(rpc_sc.resize);

});